<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>01数组遍历</title>
        <!-- 引入Vue -->
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <!-- 准备好一个容器-->
        <div id="demo">
            <ul>
                <li v-for="p in arr" :key="p.id">
                    {{p.name}}-{{p.age}}
                </li>
            </ul>
        </div>
    </body>

    <script type="text/javascript">
        //阻止 vue 在启动时生成生产提示。
        Vue.config.productionTip = false
        new Vue({
            el:'#demo',
            data:{
                arr:[
                    {id:001,name:'小明',age:12},
                    {id:002,name:'小红',age:13},
                    {id:003,name:'小绿',age:14}
                ]
            }
        })
    </script>
</html>